/**
 * Copyright (c) 2016-2021 by the respective copyright holders.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
package com.zsmartsystems.zigbee.zcl.clusters.demandresponseandloadcontrol;

import java.util.Calendar;

import javax.annotation.Generated;

import com.zsmartsystems.zigbee.zcl.ZclFieldDeserializer;
import com.zsmartsystems.zigbee.zcl.ZclFieldSerializer;
import com.zsmartsystems.zigbee.zcl.protocol.ZclCommandDirection;
import com.zsmartsystems.zigbee.zcl.protocol.ZclDataType;

/**
 * Load Control Event Command value object class.
 * <p>
 * Cluster: <b>Demand Response And Load Control</b>. Command ID 0x00 is sent <b>FROM</b> the server.
 * This command is a <b>specific</b> command used for the Demand Response And Load Control cluster.
 * <p>
 * Code is auto-generated. Modifications may be overwritten!
 */
@Generated(value = "com.zsmartsystems.zigbee.autocode.ZigBeeCodeGenerator", date = "2020-12-25T10:11:19Z")
public class LoadControlEventCommand extends ZclDemandResponseAndLoadControlCommand {
    /**
     * The cluster ID to which this command belongs.
     */
    public static int CLUSTER_ID = 0x0701;

    /**
     * The command ID.
     */
    public static int COMMAND_ID = 0x00;

    /**
     * Issuer Event ID command message field.
     * <p>
     * Unique identifier generated by the Energy provider. The value of this field allows
     * matching of Event reports with a specific Demand Response and Load Control event. The
     * expected value contained in this field shall be a unique number managed by upstream
     * systems or a UTC based time stamp (UTCTime data type) identifying when the Load Control
     * Event was issued.
     */
    private Integer issuerEventId;

    /**
     * Device Class command message field.
     * <p>
     * Bit encoded field representing the Device Class to apply the current Load Control
     * Event. Each bit, if set individually or in combination, indicates the class device(s)
     * needing to participate in the event. (Note that the participating device may be
     * different than the controlling device. For instance, a thermostat may act on behalf of
     * an HVAC compressor or furnace and/or Strip Heat/Baseboard Heater and should take
     * action on their behalf, as the thermostat itself is not subject to load shed but controls
     * devices that are subject to load shed.)
     */
    private Integer deviceClass;

    /**
     * Utility Enrollment Group command message field.
     * <p>
     * The Utility Enrollment Group field can be used in conjunction with the Device Class
     * bits. It provides a mechanism to direct Load Control Events to groups of Devices.
     * Example, by assigning two different groups relating to either Demand Response
     * programs or geographic areas, Load Control Events can be further directed for a subset
     * of Device Classes (i.e. Device Class Bit 0 and Utility Enrollment Group #1 vs. Device
     * Class Bit0 and Utility Enrollment Group #2). 0x00 addresses all groups, and values 0x01
     * to 0xFF address individual groups that match.
     * <p>
     * If the Device Class and/or Utility Enrollment Group fields don’t apply to your End
     * Device, the Load Control Event command shall be ignored by either dropping the message
     * and not replying at all or by sending back a Default Response message with a SUCCESS
     * status code.
     */
    private Integer utilityEnrollmentGroup;

    /**
     * Start Time command message field.
     * <p>
     * UTC Timestamp representing when the event is scheduled to start. A start time of
     * 0x00000000 is a special time denoting “now.” If the device would send an event with a
     * Start Time of now, adjust the Duration In Minutes field to correspond to the remainder of
     * the event.
     */
    private Calendar startTime;

    /**
     * Duration In Minutes command message field.
     * <p>
     * Duration of this event in number of minutes. Maximum value is 1440 (one day).
     */
    private Integer durationInMinutes;

    /**
     * Criticality Level command message field.
     * <p>
     * This field defines the level of criticality of this event. The action taken by load
     * control devices for an event can be solely based on this value, or combination with other
     * Load Control Event fields supported by this device. For example, additional fields
     * such as Average Load Adjustment Percentage, Duty Cycle, Cooling Temperature Offset,
     * Heating Temperature Offset, Cooling Temperature Set Point or Heating Temperature Set
     * Point can be used in combination with the Criticality level.
     */
    private Integer criticalityLevel;

    /**
     * Cooling Temperature Offset command message field.
     * <p>
     * Requested offset to apply to the normal cooling setpoint at the time of the start of the
     * event in + 0.1 oC.
     */
    private Integer coolingTemperatureOffset;

    /**
     * Heating Temperature Offset command message field.
     * <p>
     * Requested offset to apply to the normal heating setpoint at the time of the start of the
     * event in + 0.1 oC.
     */
    private Integer heatingTemperatureOffset;

    /**
     * Cooling Temperature Set Point command message field.
     * <p>
     * Requested cooling set point in 0.01 degrees Celsius.
     */
    private Integer coolingTemperatureSetPoint;

    /**
     * Heating Temperature Set Point command message field.
     * <p>
     * Requested heating set point in 0.01 degrees Celsius.
     */
    private Integer heatingTemperatureSetPoint;

    /**
     * Average Load Adjustment Percentage command message field.
     * <p>
     * Defines a maximum energy usage limit as a percentage of the client implementations
     * specific average energy usage. The load adjustment percentage is added to 100%
     * creating a percentage limit applied to the client implementations specific average
     * energy usage. A -10% load adjustment percentage will establish an energy usage limit
     * equal to 90% of the client implementations specific average energy usage. Each load
     * adjustment percentage is referenced to the client implementations specific average
     * energy usage. There are no cumulative effects.
     * <p>
     * The range of this field is -100 to +100 with a resolution of 1 percent. A -100% value equals
     * a total load shed. A 0% value will limit the energy usage to the client implementation’s
     * specific average energy usage. A +100% value will limit the energy usage to double the
     * client implementation’s specific average energy usage.
     * <p>
     * A value of 0x80 indicates the field is not used. All other values are reserved for future
     * use.
     */
    private Integer averageLoadAdjustmentPercentage;

    /**
     * Duty Cycle command message field.
     * <p>
     * Defines the maximum On state duty cycle as a percentage of time. Example, if the value is
     * 80, the device would be in an “on state” for 80% of the time for the duration of the event.
     * Range of the value is 0 to 100. A value of 0xFF indicates the field is not used. All other
     * values are reserved for future use.
     * <p>
     * Duty cycle control is a device specific issue and shall be managed by the device
     * manufacturer. It is expected that the duty cycle of the device under control will span
     * the shortest practical time period in accordance with the nature of the device under
     * control and the intent of the request for demand reduction. For typical Device Classes,
     * three minutes7 for each 10% of duty cycle is recommended. It is expected that the “off
     * state” will precede the “on state”.
     */
    private Integer dutyCycle;

    /**
     * Event Control command message field.
     * <p>
     * Identifies additional control options for the event.
     */
    private Integer eventControl;

    /**
     * Default constructor.
     *
     * @deprecated from release 1.3.0. Use the parameterised constructor instead of the default constructor and setters.
     */
    @Deprecated
    public LoadControlEventCommand() {
        clusterId = CLUSTER_ID;
        commandId = COMMAND_ID;
        genericCommand = false;
        commandDirection = ZclCommandDirection.SERVER_TO_CLIENT;
    }

    /**
     * Constructor providing all required parameters.
     *
     * @param issuerEventId {@link Integer} Issuer Event ID
     * @param deviceClass {@link Integer} Device Class
     * @param utilityEnrollmentGroup {@link Integer} Utility Enrollment Group
     * @param startTime {@link Calendar} Start Time
     * @param durationInMinutes {@link Integer} Duration In Minutes
     * @param criticalityLevel {@link Integer} Criticality Level
     * @param coolingTemperatureOffset {@link Integer} Cooling Temperature Offset
     * @param heatingTemperatureOffset {@link Integer} Heating Temperature Offset
     * @param coolingTemperatureSetPoint {@link Integer} Cooling Temperature Set Point
     * @param heatingTemperatureSetPoint {@link Integer} Heating Temperature Set Point
     * @param averageLoadAdjustmentPercentage {@link Integer} Average Load Adjustment Percentage
     * @param dutyCycle {@link Integer} Duty Cycle
     * @param eventControl {@link Integer} Event Control
     */
    public LoadControlEventCommand(
            Integer issuerEventId,
            Integer deviceClass,
            Integer utilityEnrollmentGroup,
            Calendar startTime,
            Integer durationInMinutes,
            Integer criticalityLevel,
            Integer coolingTemperatureOffset,
            Integer heatingTemperatureOffset,
            Integer coolingTemperatureSetPoint,
            Integer heatingTemperatureSetPoint,
            Integer averageLoadAdjustmentPercentage,
            Integer dutyCycle,
            Integer eventControl) {

        clusterId = CLUSTER_ID;
        commandId = COMMAND_ID;
        genericCommand = false;
        commandDirection = ZclCommandDirection.SERVER_TO_CLIENT;

        this.issuerEventId = issuerEventId;
        this.deviceClass = deviceClass;
        this.utilityEnrollmentGroup = utilityEnrollmentGroup;
        this.startTime = startTime;
        this.durationInMinutes = durationInMinutes;
        this.criticalityLevel = criticalityLevel;
        this.coolingTemperatureOffset = coolingTemperatureOffset;
        this.heatingTemperatureOffset = heatingTemperatureOffset;
        this.coolingTemperatureSetPoint = coolingTemperatureSetPoint;
        this.heatingTemperatureSetPoint = heatingTemperatureSetPoint;
        this.averageLoadAdjustmentPercentage = averageLoadAdjustmentPercentage;
        this.dutyCycle = dutyCycle;
        this.eventControl = eventControl;
    }

    /**
     * Gets Issuer Event ID.
     * <p>
     * Unique identifier generated by the Energy provider. The value of this field allows
     * matching of Event reports with a specific Demand Response and Load Control event. The
     * expected value contained in this field shall be a unique number managed by upstream
     * systems or a UTC based time stamp (UTCTime data type) identifying when the Load Control
     * Event was issued.
     *
     * @return the Issuer Event ID
     */
    public Integer getIssuerEventId() {
        return issuerEventId;
    }

    /**
     * Sets Issuer Event ID.
     * <p>
     * Unique identifier generated by the Energy provider. The value of this field allows
     * matching of Event reports with a specific Demand Response and Load Control event. The
     * expected value contained in this field shall be a unique number managed by upstream
     * systems or a UTC based time stamp (UTCTime data type) identifying when the Load Control
     * Event was issued.
     *
     * @param issuerEventId the Issuer Event ID
     * @deprecated as of 1.3.0. Use the parameterised constructor instead to ensure that all mandatory fields are provided.
     */
    @Deprecated
    public void setIssuerEventId(final Integer issuerEventId) {
        this.issuerEventId = issuerEventId;
    }

    /**
     * Gets Device Class.
     * <p>
     * Bit encoded field representing the Device Class to apply the current Load Control
     * Event. Each bit, if set individually or in combination, indicates the class device(s)
     * needing to participate in the event. (Note that the participating device may be
     * different than the controlling device. For instance, a thermostat may act on behalf of
     * an HVAC compressor or furnace and/or Strip Heat/Baseboard Heater and should take
     * action on their behalf, as the thermostat itself is not subject to load shed but controls
     * devices that are subject to load shed.)
     *
     * @return the Device Class
     */
    public Integer getDeviceClass() {
        return deviceClass;
    }

    /**
     * Sets Device Class.
     * <p>
     * Bit encoded field representing the Device Class to apply the current Load Control
     * Event. Each bit, if set individually or in combination, indicates the class device(s)
     * needing to participate in the event. (Note that the participating device may be
     * different than the controlling device. For instance, a thermostat may act on behalf of
     * an HVAC compressor or furnace and/or Strip Heat/Baseboard Heater and should take
     * action on their behalf, as the thermostat itself is not subject to load shed but controls
     * devices that are subject to load shed.)
     *
     * @param deviceClass the Device Class
     * @deprecated as of 1.3.0. Use the parameterised constructor instead to ensure that all mandatory fields are provided.
     */
    @Deprecated
    public void setDeviceClass(final Integer deviceClass) {
        this.deviceClass = deviceClass;
    }

    /**
     * Gets Utility Enrollment Group.
     * <p>
     * The Utility Enrollment Group field can be used in conjunction with the Device Class
     * bits. It provides a mechanism to direct Load Control Events to groups of Devices.
     * Example, by assigning two different groups relating to either Demand Response
     * programs or geographic areas, Load Control Events can be further directed for a subset
     * of Device Classes (i.e. Device Class Bit 0 and Utility Enrollment Group #1 vs. Device
     * Class Bit0 and Utility Enrollment Group #2). 0x00 addresses all groups, and values 0x01
     * to 0xFF address individual groups that match.
     * <p>
     * If the Device Class and/or Utility Enrollment Group fields don’t apply to your End
     * Device, the Load Control Event command shall be ignored by either dropping the message
     * and not replying at all or by sending back a Default Response message with a SUCCESS
     * status code.
     *
     * @return the Utility Enrollment Group
     */
    public Integer getUtilityEnrollmentGroup() {
        return utilityEnrollmentGroup;
    }

    /**
     * Sets Utility Enrollment Group.
     * <p>
     * The Utility Enrollment Group field can be used in conjunction with the Device Class
     * bits. It provides a mechanism to direct Load Control Events to groups of Devices.
     * Example, by assigning two different groups relating to either Demand Response
     * programs or geographic areas, Load Control Events can be further directed for a subset
     * of Device Classes (i.e. Device Class Bit 0 and Utility Enrollment Group #1 vs. Device
     * Class Bit0 and Utility Enrollment Group #2). 0x00 addresses all groups, and values 0x01
     * to 0xFF address individual groups that match.
     * <p>
     * If the Device Class and/or Utility Enrollment Group fields don’t apply to your End
     * Device, the Load Control Event command shall be ignored by either dropping the message
     * and not replying at all or by sending back a Default Response message with a SUCCESS
     * status code.
     *
     * @param utilityEnrollmentGroup the Utility Enrollment Group
     * @deprecated as of 1.3.0. Use the parameterised constructor instead to ensure that all mandatory fields are provided.
     */
    @Deprecated
    public void setUtilityEnrollmentGroup(final Integer utilityEnrollmentGroup) {
        this.utilityEnrollmentGroup = utilityEnrollmentGroup;
    }

    /**
     * Gets Start Time.
     * <p>
     * UTC Timestamp representing when the event is scheduled to start. A start time of
     * 0x00000000 is a special time denoting “now.” If the device would send an event with a
     * Start Time of now, adjust the Duration In Minutes field to correspond to the remainder of
     * the event.
     *
     * @return the Start Time
     */
    public Calendar getStartTime() {
        return startTime;
    }

    /**
     * Sets Start Time.
     * <p>
     * UTC Timestamp representing when the event is scheduled to start. A start time of
     * 0x00000000 is a special time denoting “now.” If the device would send an event with a
     * Start Time of now, adjust the Duration In Minutes field to correspond to the remainder of
     * the event.
     *
     * @param startTime the Start Time
     * @deprecated as of 1.3.0. Use the parameterised constructor instead to ensure that all mandatory fields are provided.
     */
    @Deprecated
    public void setStartTime(final Calendar startTime) {
        this.startTime = startTime;
    }

    /**
     * Gets Duration In Minutes.
     * <p>
     * Duration of this event in number of minutes. Maximum value is 1440 (one day).
     *
     * @return the Duration In Minutes
     */
    public Integer getDurationInMinutes() {
        return durationInMinutes;
    }

    /**
     * Sets Duration In Minutes.
     * <p>
     * Duration of this event in number of minutes. Maximum value is 1440 (one day).
     *
     * @param durationInMinutes the Duration In Minutes
     * @deprecated as of 1.3.0. Use the parameterised constructor instead to ensure that all mandatory fields are provided.
     */
    @Deprecated
    public void setDurationInMinutes(final Integer durationInMinutes) {
        this.durationInMinutes = durationInMinutes;
    }

    /**
     * Gets Criticality Level.
     * <p>
     * This field defines the level of criticality of this event. The action taken by load
     * control devices for an event can be solely based on this value, or combination with other
     * Load Control Event fields supported by this device. For example, additional fields
     * such as Average Load Adjustment Percentage, Duty Cycle, Cooling Temperature Offset,
     * Heating Temperature Offset, Cooling Temperature Set Point or Heating Temperature Set
     * Point can be used in combination with the Criticality level.
     *
     * @return the Criticality Level
     */
    public Integer getCriticalityLevel() {
        return criticalityLevel;
    }

    /**
     * Sets Criticality Level.
     * <p>
     * This field defines the level of criticality of this event. The action taken by load
     * control devices for an event can be solely based on this value, or combination with other
     * Load Control Event fields supported by this device. For example, additional fields
     * such as Average Load Adjustment Percentage, Duty Cycle, Cooling Temperature Offset,
     * Heating Temperature Offset, Cooling Temperature Set Point or Heating Temperature Set
     * Point can be used in combination with the Criticality level.
     *
     * @param criticalityLevel the Criticality Level
     * @deprecated as of 1.3.0. Use the parameterised constructor instead to ensure that all mandatory fields are provided.
     */
    @Deprecated
    public void setCriticalityLevel(final Integer criticalityLevel) {
        this.criticalityLevel = criticalityLevel;
    }

    /**
     * Gets Cooling Temperature Offset.
     * <p>
     * Requested offset to apply to the normal cooling setpoint at the time of the start of the
     * event in + 0.1 oC.
     *
     * @return the Cooling Temperature Offset
     */
    public Integer getCoolingTemperatureOffset() {
        return coolingTemperatureOffset;
    }

    /**
     * Sets Cooling Temperature Offset.
     * <p>
     * Requested offset to apply to the normal cooling setpoint at the time of the start of the
     * event in + 0.1 oC.
     *
     * @param coolingTemperatureOffset the Cooling Temperature Offset
     * @deprecated as of 1.3.0. Use the parameterised constructor instead to ensure that all mandatory fields are provided.
     */
    @Deprecated
    public void setCoolingTemperatureOffset(final Integer coolingTemperatureOffset) {
        this.coolingTemperatureOffset = coolingTemperatureOffset;
    }

    /**
     * Gets Heating Temperature Offset.
     * <p>
     * Requested offset to apply to the normal heating setpoint at the time of the start of the
     * event in + 0.1 oC.
     *
     * @return the Heating Temperature Offset
     */
    public Integer getHeatingTemperatureOffset() {
        return heatingTemperatureOffset;
    }

    /**
     * Sets Heating Temperature Offset.
     * <p>
     * Requested offset to apply to the normal heating setpoint at the time of the start of the
     * event in + 0.1 oC.
     *
     * @param heatingTemperatureOffset the Heating Temperature Offset
     * @deprecated as of 1.3.0. Use the parameterised constructor instead to ensure that all mandatory fields are provided.
     */
    @Deprecated
    public void setHeatingTemperatureOffset(final Integer heatingTemperatureOffset) {
        this.heatingTemperatureOffset = heatingTemperatureOffset;
    }

    /**
     * Gets Cooling Temperature Set Point.
     * <p>
     * Requested cooling set point in 0.01 degrees Celsius.
     *
     * @return the Cooling Temperature Set Point
     */
    public Integer getCoolingTemperatureSetPoint() {
        return coolingTemperatureSetPoint;
    }

    /**
     * Sets Cooling Temperature Set Point.
     * <p>
     * Requested cooling set point in 0.01 degrees Celsius.
     *
     * @param coolingTemperatureSetPoint the Cooling Temperature Set Point
     * @deprecated as of 1.3.0. Use the parameterised constructor instead to ensure that all mandatory fields are provided.
     */
    @Deprecated
    public void setCoolingTemperatureSetPoint(final Integer coolingTemperatureSetPoint) {
        this.coolingTemperatureSetPoint = coolingTemperatureSetPoint;
    }

    /**
     * Gets Heating Temperature Set Point.
     * <p>
     * Requested heating set point in 0.01 degrees Celsius.
     *
     * @return the Heating Temperature Set Point
     */
    public Integer getHeatingTemperatureSetPoint() {
        return heatingTemperatureSetPoint;
    }

    /**
     * Sets Heating Temperature Set Point.
     * <p>
     * Requested heating set point in 0.01 degrees Celsius.
     *
     * @param heatingTemperatureSetPoint the Heating Temperature Set Point
     * @deprecated as of 1.3.0. Use the parameterised constructor instead to ensure that all mandatory fields are provided.
     */
    @Deprecated
    public void setHeatingTemperatureSetPoint(final Integer heatingTemperatureSetPoint) {
        this.heatingTemperatureSetPoint = heatingTemperatureSetPoint;
    }

    /**
     * Gets Average Load Adjustment Percentage.
     * <p>
     * Defines a maximum energy usage limit as a percentage of the client implementations
     * specific average energy usage. The load adjustment percentage is added to 100%
     * creating a percentage limit applied to the client implementations specific average
     * energy usage. A -10% load adjustment percentage will establish an energy usage limit
     * equal to 90% of the client implementations specific average energy usage. Each load
     * adjustment percentage is referenced to the client implementations specific average
     * energy usage. There are no cumulative effects.
     * <p>
     * The range of this field is -100 to +100 with a resolution of 1 percent. A -100% value equals
     * a total load shed. A 0% value will limit the energy usage to the client implementation’s
     * specific average energy usage. A +100% value will limit the energy usage to double the
     * client implementation’s specific average energy usage.
     * <p>
     * A value of 0x80 indicates the field is not used. All other values are reserved for future
     * use.
     *
     * @return the Average Load Adjustment Percentage
     */
    public Integer getAverageLoadAdjustmentPercentage() {
        return averageLoadAdjustmentPercentage;
    }

    /**
     * Sets Average Load Adjustment Percentage.
     * <p>
     * Defines a maximum energy usage limit as a percentage of the client implementations
     * specific average energy usage. The load adjustment percentage is added to 100%
     * creating a percentage limit applied to the client implementations specific average
     * energy usage. A -10% load adjustment percentage will establish an energy usage limit
     * equal to 90% of the client implementations specific average energy usage. Each load
     * adjustment percentage is referenced to the client implementations specific average
     * energy usage. There are no cumulative effects.
     * <p>
     * The range of this field is -100 to +100 with a resolution of 1 percent. A -100% value equals
     * a total load shed. A 0% value will limit the energy usage to the client implementation’s
     * specific average energy usage. A +100% value will limit the energy usage to double the
     * client implementation’s specific average energy usage.
     * <p>
     * A value of 0x80 indicates the field is not used. All other values are reserved for future
     * use.
     *
     * @param averageLoadAdjustmentPercentage the Average Load Adjustment Percentage
     * @deprecated as of 1.3.0. Use the parameterised constructor instead to ensure that all mandatory fields are provided.
     */
    @Deprecated
    public void setAverageLoadAdjustmentPercentage(final Integer averageLoadAdjustmentPercentage) {
        this.averageLoadAdjustmentPercentage = averageLoadAdjustmentPercentage;
    }

    /**
     * Gets Duty Cycle.
     * <p>
     * Defines the maximum On state duty cycle as a percentage of time. Example, if the value is
     * 80, the device would be in an “on state” for 80% of the time for the duration of the event.
     * Range of the value is 0 to 100. A value of 0xFF indicates the field is not used. All other
     * values are reserved for future use.
     * <p>
     * Duty cycle control is a device specific issue and shall be managed by the device
     * manufacturer. It is expected that the duty cycle of the device under control will span
     * the shortest practical time period in accordance with the nature of the device under
     * control and the intent of the request for demand reduction. For typical Device Classes,
     * three minutes7 for each 10% of duty cycle is recommended. It is expected that the “off
     * state” will precede the “on state”.
     *
     * @return the Duty Cycle
     */
    public Integer getDutyCycle() {
        return dutyCycle;
    }

    /**
     * Sets Duty Cycle.
     * <p>
     * Defines the maximum On state duty cycle as a percentage of time. Example, if the value is
     * 80, the device would be in an “on state” for 80% of the time for the duration of the event.
     * Range of the value is 0 to 100. A value of 0xFF indicates the field is not used. All other
     * values are reserved for future use.
     * <p>
     * Duty cycle control is a device specific issue and shall be managed by the device
     * manufacturer. It is expected that the duty cycle of the device under control will span
     * the shortest practical time period in accordance with the nature of the device under
     * control and the intent of the request for demand reduction. For typical Device Classes,
     * three minutes7 for each 10% of duty cycle is recommended. It is expected that the “off
     * state” will precede the “on state”.
     *
     * @param dutyCycle the Duty Cycle
     * @deprecated as of 1.3.0. Use the parameterised constructor instead to ensure that all mandatory fields are provided.
     */
    @Deprecated
    public void setDutyCycle(final Integer dutyCycle) {
        this.dutyCycle = dutyCycle;
    }

    /**
     * Gets Event Control.
     * <p>
     * Identifies additional control options for the event.
     *
     * @return the Event Control
     */
    public Integer getEventControl() {
        return eventControl;
    }

    /**
     * Sets Event Control.
     * <p>
     * Identifies additional control options for the event.
     *
     * @param eventControl the Event Control
     * @deprecated as of 1.3.0. Use the parameterised constructor instead to ensure that all mandatory fields are provided.
     */
    @Deprecated
    public void setEventControl(final Integer eventControl) {
        this.eventControl = eventControl;
    }

    @Override
    public void serialize(final ZclFieldSerializer serializer) {
        serializer.serialize(issuerEventId, ZclDataType.UNSIGNED_32_BIT_INTEGER);
        serializer.serialize(deviceClass, ZclDataType.BITMAP_16_BIT);
        serializer.serialize(utilityEnrollmentGroup, ZclDataType.UNSIGNED_8_BIT_INTEGER);
        serializer.serialize(startTime, ZclDataType.UTCTIME);
        serializer.serialize(durationInMinutes, ZclDataType.UNSIGNED_16_BIT_INTEGER);
        serializer.serialize(criticalityLevel, ZclDataType.ENUMERATION_8_BIT);
        serializer.serialize(coolingTemperatureOffset, ZclDataType.UNSIGNED_8_BIT_INTEGER);
        serializer.serialize(heatingTemperatureOffset, ZclDataType.UNSIGNED_8_BIT_INTEGER);
        serializer.serialize(coolingTemperatureSetPoint, ZclDataType.SIGNED_16_BIT_INTEGER);
        serializer.serialize(heatingTemperatureSetPoint, ZclDataType.SIGNED_16_BIT_INTEGER);
        serializer.serialize(averageLoadAdjustmentPercentage, ZclDataType.SIGNED_8_BIT_INTEGER);
        serializer.serialize(dutyCycle, ZclDataType.UNSIGNED_8_BIT_INTEGER);
        serializer.serialize(eventControl, ZclDataType.BITMAP_8_BIT);
    }

    @Override
    public void deserialize(final ZclFieldDeserializer deserializer) {
        issuerEventId = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_32_BIT_INTEGER);
        deviceClass = (Integer) deserializer.deserialize(ZclDataType.BITMAP_16_BIT);
        utilityEnrollmentGroup = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_8_BIT_INTEGER);
        startTime = (Calendar) deserializer.deserialize(ZclDataType.UTCTIME);
        durationInMinutes = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_16_BIT_INTEGER);
        criticalityLevel = (Integer) deserializer.deserialize(ZclDataType.ENUMERATION_8_BIT);
        coolingTemperatureOffset = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_8_BIT_INTEGER);
        heatingTemperatureOffset = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_8_BIT_INTEGER);
        coolingTemperatureSetPoint = (Integer) deserializer.deserialize(ZclDataType.SIGNED_16_BIT_INTEGER);
        heatingTemperatureSetPoint = (Integer) deserializer.deserialize(ZclDataType.SIGNED_16_BIT_INTEGER);
        averageLoadAdjustmentPercentage = (Integer) deserializer.deserialize(ZclDataType.SIGNED_8_BIT_INTEGER);
        dutyCycle = (Integer) deserializer.deserialize(ZclDataType.UNSIGNED_8_BIT_INTEGER);
        eventControl = (Integer) deserializer.deserialize(ZclDataType.BITMAP_8_BIT);
    }

    @Override
    public String toString() {
        final StringBuilder builder = new StringBuilder(526);
        builder.append("LoadControlEventCommand [");
        builder.append(super.toString());
        builder.append(", issuerEventId=");
        builder.append(issuerEventId);
        builder.append(", deviceClass=");
        builder.append(deviceClass);
        builder.append(", utilityEnrollmentGroup=");
        builder.append(utilityEnrollmentGroup);
        builder.append(", startTime=");
        builder.append(startTime);
        builder.append(", durationInMinutes=");
        builder.append(durationInMinutes);
        builder.append(", criticalityLevel=");
        builder.append(criticalityLevel);
        builder.append(", coolingTemperatureOffset=");
        builder.append(coolingTemperatureOffset);
        builder.append(", heatingTemperatureOffset=");
        builder.append(heatingTemperatureOffset);
        builder.append(", coolingTemperatureSetPoint=");
        builder.append(coolingTemperatureSetPoint);
        builder.append(", heatingTemperatureSetPoint=");
        builder.append(heatingTemperatureSetPoint);
        builder.append(", averageLoadAdjustmentPercentage=");
        builder.append(averageLoadAdjustmentPercentage);
        builder.append(", dutyCycle=");
        builder.append(dutyCycle);
        builder.append(", eventControl=");
        builder.append(eventControl);
        builder.append(']');
        return builder.toString();
    }

}
